package org.logic.fuzzysets.summarizers.age;

import org.dataSource.DataBaseInfo;
import org.logic.fuzzysets.AFuzzySet;
import org.logic.membershipFunctions.TriangularFunction;

public class OldFuzzySet extends AFuzzySet{

	public OldFuzzySet(DataBaseInfo db) {

		double middleFactor = 1.0;
		setMembershipFunction(new TriangularFunction(db.getMinAge(),db.getMaxAge(),middleFactor));
		setUniverse(db.getAllAges());
	}

	public OldFuzzySet(DataBaseInfo db, String subject) {
		db.setOnlyRecords(subject);
		setSubject(subject);
		double middleFactor = 1.0;
		setMembershipFunction(new TriangularFunction(db.getMinAge(),db.getMaxAge(),middleFactor));
		setUniverse(db.getAllAges());
	}
	
	@Override
	public String getLabel() {
		AFuzzySet qualifier = getQualifier();
		if(qualifier != null && getSubject()==null)
		return " who "+qualifier.getLabel()+" are old";
		else
		return "are old";
	}

}
